/**
 * @param {string} s
 * @return {boolean}
 */

var isPalindrome = function (s) {
    s = s.toLowerCase()
        .split("")
        .filter((val) => {
            if (("0" <= val && val <= "9") || ("a" <= val && val <= "z")) {
                return true
            } else {
                return false
            }
        })
        .join("")
    let str = s.split("").reverse().join("")
    // console.log(s, str)
    if (s === str) {
        return true
    }
    return false
};
console.log(isPalindrome("A man, a plan, a canal: Panama"))